fn main() {
    let mut user1 = User{
        active: true,
        username: String::from("someusername123"),
        email: String::from("someone@example.com"),
        sign_in_count: 1,
    };
    user1.email = String::from("869540029@qq.com");
    //使用一个结构体赋予另一个结构体
    let user2 = User{
        active: user1.active,
        username: user1.username,
        email: String::from("another@example.com"),
        sign_in_count: user1.sign_in_count,
    };

    //使用..语法
    let user3 = User {
        email: String::from("another@qq.com"),
        ..user1
    };
    let subject = AlwaysEqual;
}
struct User{
    active: bool,
    username: String,
    email: String,
    sign_in_count: u64,
}
struct AlwaysEqual;
fn build_user(email:String,username:String)->User{
    User{
        active: true,
        username: username,
        email: email,
        sign_in_count: 1,
    }
}
//简写语法
fn build_user1(email:String,username:String)->User{
    User{
        active: true,
        username,
        email,
        sign_in_count: 1,
    }
}